import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Endstart
 * Date: 2021-06-26
 * Time: 10:53
 */
public class Main123456432 {

    public static void main(String[] args) {
        ArrayList<Integer> list = new ArrayList<>();
        int[] myArray = {2, 4, 6, 8, 10, 1, 3, 5, 7, 9};
        int offset = 0;
        for (int index = 0; index < myArray.length / 2; ++index) {
            if (index % 2 == 0) {
                list.add(myArray[index + offset++]);
            }
        }
        for (Integer n : list) {
            System.out.println(n);
        }
    }

    public void countWord(String filename) {
        File file = new File(filename);
        if (!file.exists()) {
            System.out.println("No such file");
            return;
        }
        int count = 0;
        try (BufferedReader bufferedReader = new BufferedReader(new FileReader(file))) {
            String line = null;
            while ((line = bufferedReader.readLine()) != null) {
                count += line.split(" ").length;
            }
        } catch (IOException e) {
        }

        if (count > 0) {
            System.out.println("There are " + count + " words in " + filename);
        } else {
            System.out.println("The file is empty");
        }
    }

}
